<template>
  <div id="app">
    <login v-if="isToLogin"></login>
    <commonNav v-else />
  </div>
</template>
<script>
import commonNav from '@/components/commonNav.vue'
import login from '@/pages/login.vue'
export default {
  name: 'app',
  components: {
    commonNav,
    login
  },
  data() {
    return {
      isToLogin:false,
    }
  },
  created() {    
    if (localStorage.getItem('userInfo')) {
      this.isToLogin = false;
    } else {
      this.isToLogin = true;
    }
  },
  methods: {
  }
}
</script>

<style>
#app {
  height: 100%;
}
</style>
